import {Injectable} from "@nestjs/common";
import {IRedisService} from "apps/ddd-infrastructure/src/persistent/redis/IRedisService.interface";
import {RedisService} from "apps/ddd-infrastructure/src/persistent/redis/RedisService";
import {DemoRepository} from "apps/ddd-infrastructure/src/persistent/repository/DemoRepository";


@Injectable()
export class DemoService{

    constructor(
        private readonly redisService:RedisService,
        private readonly demoRepository:DemoRepository,
    ) {
    }

    public hello():Promise<unknown>{
        return this.redisService.getValue("dahua:visitorDefaultConfig");
    }

    public databaseTest():Promise<unknown>{
        return this.demoRepository.queryDemoTestOneById(1);
    }

}